package com.taotao.cart.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import com.taotao.cart.pojo.User;

@Service
public class UserService {

	@Autowired
	private RestTemplate restTemplate;
	
	@Value("${TAOTAO_SSO_QUERY_TOKEN}")
	private String TAOTAO_SSO_QUERY_TOKEN;
	
	public User queryUserByToken(String token){
		return this.restTemplate.getForObject(TAOTAO_SSO_QUERY_TOKEN + token + ".html", User.class);
	}
}
